local str = {}

function str.split(str, sep)
    if sep == nil then sep = "%s" end
    local tab = {}
    local index = 1
    local pattern = string.format("([^%s]+)", sep)
    for subs in string.gmatch(str, pattern) do
        tab[index] = subs
        index = index + 1
    end
    return tab
end

return str
